- time_tracker = User.current.hourglass_time_tracker
- if @issue.nil?
  -# operations on multiple issues
- elsif time_tracker && time_tracker.issue_id == @issue.id
  li
    = render partial: 'hooks/time_tracker/stop_link', locals: {time_tracker: time_tracker, issue: @issue}
    - if !Hourglass::SettingsStorage[:global_tracker] && time_tracker.project.present? && time_tracker.activity.blank?
      = render partial: 'hooks/time_tracker/activity_dialog_content', locals: {time_tracker: time_tracker}
- elsif Pundit.policy!(User.current, Hourglass::TimeTracker.new(issue_id: @issue.id)).start?
  li
    = render partial: 'hooks/time_tracker/start_link', locals: {time_tracker: time_tracker, issue: @issue, time_tracker_data: {params: {time_tracker: {issue_id: @issue.id}}}}
    - if time_tracker
      = render partial: 'hooks/time_tracker/start_dialog_content', locals: {time_tracker: time_tracker, issue: nil}
